{include file="public/header" /}



<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>{$Think.lang.ds_statindustry}</h3>
                <h5></h5>
            </div>
            {include file="public/admin_items" /}
        </div>
    </div>

    <form method="get"  name="formSearch" id="formSearch">
        <div class="ds-search-form">
            <dl>
                <dd id="searchgc_td"></dd>
                    <input type="hidden" id="choose_gcid" name="choose_gcid" value="0"/>
                    <dd>
                        <select name="search_type" id="search_type" class="querySelect">
                            <option value="day" {if $Request.get.search_type == 'day'}selected{/if}>{$Think.lang.search_type_day}</option>
                            <option value="week" {if $Request.get.search_type == 'week'}selected{/if}>{$Think.lang.search_type_week}</option>
                            <option value="month" {if $Request.get.search_type == 'month'}selected{/if}>{$Think.lang.search_type_month}</option>
                        </select>
                    </dd>
                    <dd id="searchtype_day" style="display:none;">
                        <input class="txt date" type="text" value="{$search_arr.day.search_time|date='Y-m-d'}" id="search_time" name="search_time">
                    </dd>
                    <dd id="searchtype_week" style="display:none;">
                        <select name="searchweek_year" class="querySelect">
                            {foreach name="year_arr" item="v"}
                            <option value="{$key}"{if $search_arr.week.current_year == $key} selected{/if}>{$v}</option>
                            {/foreach}
                        </select>
                        <select name="searchweek_month" class="querySelect">
                            {foreach name="month_arr" item="v"}
                            <option value="{$key}" {if $search_arr.week.current_month == $key} selected{/if}>{$v}</option>
                            {/foreach}
                        </select>
                        <select name="searchweek_week" class="querySelect">
                            {foreach name="week_arr" item="v"}
                            <option value="{$v.key}" {if $search_arr.week.current_week == $v.key}selected{/if}>{$v.val}</option>
                            {/foreach}
                        </select>
                    </dd>
                    <dd id="searchtype_month" style="display:none;">
                        <select name="searchmonth_year" class="querySelect">
                            {foreach name="year_arr" item="v"}
                            <option value="{$key}" {if $search_arr.month.current_year == $key}selected{/if}>{$v}</option>
                            {/foreach}
                        </select>
                        <select name="searchmonth_month" class="querySelect">
                            {foreach name="month_arr" item="v"}
                            <option value="{$key}" {if $search_arr.month.current_month == $key}selected{/if}>{$v}</option>
                            {/foreach}
                        </select>
                    </dd>
            </dl>
           
            <div class="btn_group">
                <a href="javascript:document.formSearch.submit();" class="btn tooltip" title="{$Think.lang.ds_query}">{$Think.lang.ds_query}</a>
                <a href="{:url('Statindustry/price')}" class="btn btn-default" title="{$Think.lang.ds_cancel}">{$Think.lang.ds_cancel}</a>
            </div>
        </div>
    </form>

    
    <div class="explanation" id="explanation">
        <div class="title" id="checkZoom">
            <h4 title="{$Think.lang.ds_explanation_tip}">{$Think.lang.ds_explanation}</h4>
            <span id="explanationZoom" title="{$Think.lang.ds_explanation_close}" class="arrow"></span>
        </div>
        <ul>
            <li>{$Think.lang.stat_validorder_explain}</li>
            <li>{$Think.lang.statindustry_price_help1}</li>
            <li>{$Think.lang.statindustry_price_help2}</li>
        </ul>
    </div>

    <table class="ds-default-table">
        <thead class="thead">
        <tr class="space">
            <th>{$Think.lang.statindustry_distribution}（<a href="{:url('Statgeneral/setting')}" style="font-size:12px; font-weight:normal;">{$Think.lang.statgeneral_setting}</a>）</th>
        </tr>
        </thead>
        <tbody>
        {if $goodsnum_stat_json || $orderamount_stat_json}
        <tr>
            <td>
                <div id="container_orderamount" class="w100pre close_float" style="height:400px"></div>
            </td>
        </tr>
        <tr><td></td></tr>
        <tr>
            <td>
                <div id="container_goodsnum" class="w100pre close_float" style="height:400px"></div>
            </td>
        </tr>
       {else /}
        <tr>
            <td>
                <div class="w100pre close_float align-center h36 mt10">{$Think.lang.statindustry_setting_tips}<a href="{:url('Statgeneral/setting')}" style="font-size:12px; font-weight:normal;">{$Think.lang.statgoods_set_now}</a></div>
            </td>
        </tr>
       {/if}
        </tbody>
    </table>
</div>
<script>
    jQuery.browser={};(function(){jQuery.browser.msie=false; jQuery.browser.version=0;if(navigator.userAgent.match(/MSIE ([0-9]+)./)){ jQuery.browser.msie=true;jQuery.browser.version=RegExp.$1;}})();
</script>
<script src="{$Think.PLUGINS_SITE_ROOT}/jquery.poshytip.min.js"></script>
<script src="{$Think.PLUGINS_SITE_ROOT}/mlselection.js"></script>
<script src="{$Think.PLUGINS_SITE_ROOT}/highcharts/highcharts.js"></script>
<script>
    //展示搜索时间框
    function show_searchtime(){
        s_type = $("#search_type").val();
        $("[id^='searchtype_']").hide();
        $("#searchtype_"+s_type).show();
    }

    $(function () {
        //统计数据类型
        var s_type = $("#search_type").val();
        $('#search_time').datepicker({dateFormat: 'yy-mm-dd'});

        show_searchtime();
        $("#search_type").change(function(){
            show_searchtime();
        });

        //更新周数组
        $("[name='searchweek_month']").change(function(){
            var year = $("[name='searchweek_year']").val();
            var month = $("[name='searchweek_month']").val();
            $("[name='searchweek_week']").html('');
            $.getJSON("{:url('Common/getweekofmonth')}",{y:year,m:month},function(data){
                if(data != null){
                    for(var i = 0; i < data.length; i++) {
                        $("[name='searchweek_week']").append('<option value="'+data[i].key+'">'+data[i].val+'</option>');
                    }
                }
            });
        });
        //商品分类
        init_gcselect({$gc_choose_json|raw},{$gc_json|raw});

        $('#container_orderamount').highcharts({$orderamount_stat_json|raw});
        $('#container_goodsnum').highcharts({$goodsnum_stat_json|raw});


    });
</script>